import { useAuthStore } from "../store/auth";

// fetchSteamPost
export const fetchSteamPost = (url: string, data = {}) => {
    const headers = new Headers();
    const authStore = useAuthStore();
    if (authStore.token) {
        headers.append('Authorization', `Bearer ${authStore.token}`);
    }
    headers.append('Accept', 'text/event-stream');
    headers.append('Content-Type', 'application/json');
    return fetch(url, {
        method: 'POST',
        headers: headers,
        body: JSON.stringify(data)
    })
}